from rest_framework.pagination import PageNumberPagination


class GlobalPagination(PageNumberPagination):
    """
    list/?page=4&size=20
    """
    page_size = 10  # 默认每页数目
    page_size_query_param = 'size'  # 前端发送的每页数目关键字名，默认为None
    max_page_size = 100  # 前端最多能设置的每页数量